package com.ruoyi.enterprise.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.enterprise.mapper.EContractMapper;
import com.ruoyi.common.core.domain.e_enterprise.EContract;
import com.ruoyi.enterprise.service.IEContractService;

/**
 * 合同Service业务层处理
 * 
 * @author JYW
 * @date 2024-01-30
 */
@Service
public class EContractServiceImpl implements IEContractService 
{
    @Autowired
    private EContractMapper eContractMapper;

    /**
     * 查询合同
     * 
     * @param id 合同主键
     * @return 合同
     */
    @Override
    public EContract selectEContractById(Long id)
    {
        return eContractMapper.selectEContractById(id);
    }

    /**
     * 查询合同列表
     * 
     * @param eContract 合同
     * @return 合同
     */
    @Override
    public List<EContract> selectEContractList(EContract eContract)
    {
        return eContractMapper.selectEContractList(eContract);
    }

    /**
     * 新增合同
     * 
     * @param eContract 合同
     * @return 结果
     */
    @Override
    public int insertEContract(EContract eContract)
    {
        eContract.setCreateTime(DateUtils.getNowDate());
        return eContractMapper.insertEContract(eContract);
    }

    /**
     * 修改合同
     * 
     * @param eContract 合同
     * @return 结果
     */
    @Override
    public int updateEContract(EContract eContract)
    {
        eContract.setUpdateTime(DateUtils.getNowDate());
        return eContractMapper.updateEContract(eContract);
    }

    /**
     * 批量删除合同
     * 
     * @param ids 需要删除的合同主键
     * @return 结果
     */
    @Override
    public int deleteEContractByIds(Long[] ids)
    {
        return eContractMapper.deleteEContractByIds(ids);
    }

    /**
     * 删除合同信息
     * 
     * @param id 合同主键
     * @return 结果
     */
    @Override
    public int deleteEContractById(Long id)
    {
        return eContractMapper.deleteEContractById(id);
    }
}
